TARGET = libSingleton.so

SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)

CFLAGS += -fPIC
LDFLAGS += -shared

$(TARGET): $(OBJS)
	$(CXX) $(LDFLAGS) $^ -o $@

%.o: %.cpp
	$(CXX) $(CFLAGS) $^ -c

default: $(TARGET)

.PHONY: clean

DEMO = demo
$(DEMO): Demo.cc
	$(CXX) $^ -lSingleton -lpthread -L./ -DDEBUG_SINGLETON -std=c++98 -o $@


clean:
	$(info "OBJS :$(OBJS)")
	rm -f $(OBJS)
	rm -f $(TARGET)
	rm -f $(DEMO)